#pragma once
#include <vector>

#define GSL_DBL_EPSILON        2.2204460492503131e-16
#define GSL_SQRT_DBL_EPSILON   1.4901161193847656e-08

class fit_modul
{
public:
	fit_modul(void);
	~fit_modul(void);

	enum Error(PARAMETERCOUNT_DOESNT_MATCH);
	std::vector<double> xdata;
	std::vector<double> ydata;
	
	struct parameter{
	double value;
	std::string name;
	bool fit;
	//double grad_weight;
	};

	struct vecma{
	std::vector<double> f;
	std::vector<std::vector<double> >df;
	};

	virtual std::vector<double> f();
	virtual std::vector<std::vector<double> > df();
	virtual vecma fdf();
	
	std::vector<parameter> getparams();
	int setparams(std::vector<double> param);
	int getparamcount();
	std::vector<parameter> param;
	std::string filename;

private:
	
	int paramsize;

};

